package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	import flash.geom.Vector3D;
	import flash.utils.Timer;
	import flash.utils.getTimer;
	
	public class isotest extends Sprite
	{
		public function isotest()
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			Globals.lastTime = Globals.currentTime = getTimer();
			var cfg:WorldConfig = new WorldConfig();
			cfg.renderStyle = WorldConfig.RENDER_STYLE_ISOMETRIC;
			cfg.renderStyle = WorldConfig.RENDER_STYLE_SIMPLE_GRID;
			var world:World = new World();
			world.configure(cfg);
			
			
			var i:int, il:int, j:int, jl:int, k:int, kl:int;
			
//			for(i = 0; i < 10; i++){
//				for(j = 0; j < 10; j++){
//					for(k = 0; k < 2; k++){
//						var gobj:GameObject = new GameObject();
//						gobj.setPosition(new Vector3D(i, j, k));
//						world.add(gobj);
//					}
//				}
//			}

			world.setParent(this);
				
			addEventListener(Event.ENTER_FRAME, function(e:Event):void{
				Globals.currentTime = getTimer();
				Globals.deltaTime = Globals.currentTime - Globals.lastTime;
				world.update();
				
				Globals.lastTime = Globals.currentTime;
			});
			
			stage.addEventListener(MouseEvent.CLICK, function(me:MouseEvent):void{
				for(var n:int = 0; n < 50; n++){
				var gobj:GameObject = new GameObject();
				gobj.setPosition(new Vector3D(0,0,0));
				world.add(gobj);				
				}
			});
		}
	}
}